package com.acs.attestation.controller;


import com.acs.attestation.data.ResultData;
import com.acs.attestation.entity.CardEntity;
import com.acs.attestation.service.CardService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 杰
 * @Description:
 * @date 2022/4/27 23:53
 */
@RestController
@RequestMapping("/attestation")
public class CardController {
    @Resource
    private CardService cardService;

    //todo 新增认证
    @PostMapping("/card/add")
    public AjaxResult add(@Validated @RequestBody CardEntity cardEntity) {
        int result = cardService.add(cardEntity);
        return new ResultData().toAjax(result);
    }


    //todo 修改认证
    @PostMapping("/card/update")
    public AjaxResult update(@Validated @RequestBody CardEntity cardEntity){
         int result = cardService.update(cardEntity);
         return new ResultData().toAjax(result);
    }

    //todo 删除认证信息
    @DeleteMapping("/card/del/{ids}")
    public AjaxResult del(@PathVariable Long[] ids){
        int result = cardService.del(ids);
        return new ResultData().toAjax(result);
    }

    //todo 查询认证信息










}
